FROM centos:7
ARG DM_INSTALL_TMP=/opt/dm-setup
ENV DM_PATH=/opt/dameng
RUN useradd --base-dir /home/dm --home-dir /home/dm --no-create-home --user-group dm
COPY --chown=dm:dm ./setup-dir $DM_INSTALL_TMP
RUN chmod +x $DM_INSTALL_TMP/DMInstall.bin && mkdir $DM_PATH && chown dm:dm -R $DM_PATH
RUN /bin/bash $DM_INSTALL_TMP/DMInstall.bin -q $DM_INSTALL_TMP/dameng-install.xml
RUN cp $DM_INSTALL_TMP/docker-entrypoint.sh $DM_PATH/docker-entrypoint.sh && chmod +x $DM_PATH/docker-entrypoint.sh && rm -rf $DM_INSTALL_TMP
VOLUME $DM_PATH
EXPOSE 5236
ENTRYPOINT $DM_PATH/docker-entrypoint.sh
